﻿using System;
public interface A
{
    double area();
}
public interface B
{
    void setColor(string c);
}
public interface C : A, B
{
    void volume();
}
public class Cylinder : C
{

    private double radius;
    private double height;
    private string color;
    public Cylinder(double radius, double height, string color)
    {
        this.radius = radius;
        this.height = height;
        this.color = color;
    }
    public double area()
    {
        return 2 * Math.PI * radius * height;
    }
    public void setColor(string c)
    {
        color = c;
    }
    public void volume()
    {
        double vol = Math.PI * radius * radius * height;
        Console.WriteLine($"圆柱体体积: {vol:F2}");
        Console.WriteLine($"圆柱体颜色: {color}");
    }
}

class Program
{
    static void Main(string[] args)
    {
        Cylinder cylinder = new Cylinder(3, 5, "蓝色");
        Console.WriteLine("蓝色圆柱体：");
        double surfaceArea = cylinder.area();
        Console.WriteLine($"圆柱体侧面积: {surfaceArea:F2}");
        cylinder.setColor("红色");
        Console.WriteLine("修改后圆柱体：");
        cylinder.volume();
        Console.ReadLine();
    }
}
